home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re Reading Formatted Text.4 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.1 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Reading Formatted Text
  2. Sent:        6/12/96 4:59 AM
  3. Received:    6/12/96 8:31 AM
  4. From:        Serge Froment, sfroment@odyssee.net
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >Yes, efficiency might be a concern with the code you show.  Suppose you
  9. >read in a couple hundred bytes (length==200), and there are no delimiters,
  10. >or \r characters.  FW_CString::FindCharacter will have to make two passes
  11. >through the data to determine that.
  12.  
  13. Yes, that is the point that concerned me. For that reason, I decided to
  14. fetch one character at a time from the reader and copy to the string only
  15. the characters up to the delimiter/return using a FW_CStringWriter. This
  16. class is optimized to copy characters to the string in 32-byte bundles, so
  17. the string buffer is not increased at every character. Doing it that way
  18. also takes care of the fact that FW_CString does not know about FW_LChar.
  19.  
  20. At first, I had the impression FW_CString was missing some useful methods,
  21. but now that I see it can be used with text readers/writers, I really like
  22. the design.
  23.  
  24. Thanks for your help.
  25.  
  26. Serge
  27.  
  28.